// fn main() {
//     let r;
//     {
//         let x = 5;
//         r = &x;
//     }
//     println!("r: {}",r);
// }


// fn main(){
//     let string1 = String::from("bacd");
//     {

    
//     let string2 = "xyz";

//     let result = longest(string1.as_str(),string2);
//     println!("The longest string is {}", result);}
// }
// fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {
//     if x.len()>y.len(){
//         x
//     }else{
//         y
//     }
// }
#[derive(Debug)]
struct ImportantExcerpt<'a>{
    part: &'a str,
}

fn main(){
    let novel = String::from("Call me Ishhmael. Some years ago...");
    let first_sentence = novel.split('.').next().expect("Could not find a '.'");
    let i = ImportantExcerpt{
        part: first_sentence,
    };
    println!("{:?}",i);
}